package com.san.hkhospital.intercepter;

import com.san.hkhospital.entity.Sysuser;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * ClassName:LoginInterceptor
 * PackageName:com.san.hkhospital.intercepter
 * Description:
 *
 * @Author:yy
 * @CreatedAt:2024/11/12 14:14
 */

public class LoginInterceptor implements HandlerInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        HttpSession session = request.getSession();
        Sysuser login = (Sysuser) session.getAttribute("login");

        if(login!=null){
            return true;
        }
        return false;

    }
}
